package video.web;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * url example http://v.pps.tv/play_31WO9J.html
 * @author ladjzero
 *
 */
public class Pps extends SuperParser{
	
	public Pps(String videoUrl) {
		super(videoUrl);
	}

	public String getImage(){
		Pattern pattern = Pattern.compile("v_pic: \"(.+?)\",");
		Matcher matcher = pattern.matcher("");
		if(null!=content)
			matcher = pattern.matcher(content);
		while(matcher.find())
			return matcher.group(1);
		return null;
	}
	
	public String getSwf(){
		return "http://player.pps.tv/player/sid/"+getIdFromVideoUrl( videoUrl )+"/v.swf";
	}
	
	private String getIdFromVideoUrl(String videoUrl){
		return videoUrl.substring( videoUrl.indexOf("_")+1, videoUrl.indexOf(".html") );
	}
}
